//
//  ScrollViewCell.swift
//  ams
//
//  Created by yangyuan on 2017/6/26.
//  Copyright © 2017年 coterjiesen. All rights reserved.
//

import UIKit
import LLCycleScrollView


class ScrollViewCell: UITableViewCell{
    
    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
    }
    required override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        setupUI()
    }
    
    func setupUI(){
        // 网络图，本地图混合
        let imagesURLStrings = [
            "30.jpg",
            "ic_scoll_1",
            "ic_scoll_2",
            "ic_scoll_3",
            "ic_scoll_4",
            ];
        
        // 图片配文字
        let titles = ["感谢您的支持",
                      "欢迎使用资产管理系统",
        ];
        
        // Demo--点击回调
        let introduceScro = LLCycleScrollView.llCycleScrollViewWithFrame(CGRect.init(x: 0, y: 0, width: SCREEN_WIDTH, height: 130), imageURLPaths: imagesURLStrings, titles:titles, didSelectItemAtIndex: { index in
            print("当前点击图片的位置为:\(index)")
        })
        introduceScro.customPageControlStyle = .pill
        introduceScro.autoScrollTimeInterval = 3.0
        introduceScro.customPageControlInActiveTintColor = UIColor.red
        // 下边约束
        introduceScro.pageControlBottom = 12
        self.contentView.addSubview(introduceScro)
    }
}
